#include <iostream>
#include<vector>
#include<algorithm>
#include<list>
using namespace std;

int num[10]={0};
int my_index[11]={0};
vector<int> arr;

void fill_in_num(string tel)
{
    for (int i = 0; i < tel.length(); i++)
    {
        num[tel[i] - '0'] = 1;
    }
}

void fill_in_arr()
{
    for (int i = 9; i >=0; i--)
    {
        if(num[i]==1)
        {
            arr.push_back(i);
        }
    }
}

void fill_in_my_index(string tel)
{
    for(int i = 0; i < tel.length(); i++)
    {
        vector<int>::iterator it = find(arr.begin(), arr.end(), tel[i]-'0');
        int pos = distance(arr.begin(), it);
        my_index[i] = pos;
    }
}

int main()
{
    string tel;
    cin >> tel;
    // 确认电话包含数字
    fill_in_num(tel);
    // 给num里的数字排序
    fill_in_arr();
    // 根据电话填充my_index
    fill_in_my_index(tel);

    cout << "int[] arr = new int[]{";
    for (vector<int>::iterator it = arr.begin(); it != arr.end(); it++)
    {
        cout << *it;
        if(it!=(arr.end()-1))
        {
            cout << ",";
        }
    }
    cout << "};" << endl;
    cout << "int[] index = new int[]{";
    for (int i = 0; i < 11; i++)
    {
        cout << my_index[i];
        if(i!=10)
        {
            cout << ",";
        }
    }
    cout << "};";
    return 0;
}